import { createSlice } from '@reduxjs/toolkit'

const initialState = {
    name: "",
    pic: ""
}

export const userInFoSlice = createSlice({
    name: 'user',
    initialState,
    reducers: {
        setUser(state, action) {
            state.name = action.payload.name
            state.pic = action.payload.pic
        }
    },
})

// Action creators are generated for each case reducer function
export const { setUser } = userInFoSlice.actions

export default userInFoSlice.reducer